package Framework;

import java.awt.Graphics;
import java.awt.Rectangle;

public class pnl_Scrollable_InternalFrame extends pnl_Ancestor {
	 boolean ib_BackgroundFloating = false;
	 Rectangle irect_BackgroundSize;
	
	 
	 public void setBackgroundFloating(boolean ab_isFloat, Rectangle arect_BackgroundSize){
		// If the background floats, it stays independant of buttons.
		// Needs Rect argument as doesnt know size. 
		ib_BackgroundFloating = ab_isFloat;
		irect_BackgroundSize = arect_BackgroundSize; //lol i just said arect. 
	 }
	 
	 public void paintComponent( Graphics g )  
     {  
         if( backgroundImage == null ){
     		setBackgroundImage(ConfigOpts.IMAGE_BACKGROUND_STANDARD);
     	 }
         if (ib_BackgroundFloating){
        	 System.out.println("Floating!");
        	 g.drawImage(backgroundImage.getImage(), this.getBounds().x * -1, this.getBounds().y * -1, irect_BackgroundSize.width, irect_BackgroundSize.height, this);
         } else {
        	 g.drawImage(backgroundImage.getImage(), 0, 0, this.getWidth(), this.getHeight(), this);
         }
     }
}
